<?php use_helper('I18N') ?>

<script type="text/javascript">
    $(function() {
        $(".editLink").button({
            icons: {
                primary: "ui-icon-circle-check"
            }
        })
        $("#btnCreate").button({
            icons: {
                primary: "ui-icon-circle-plus"
            }
        })
    });
</script>

<div style="padding: 10px; top: 10px; width: 98%">
    <div class="portlet" id="sf_admin_container">
        <div class="portlet-header">Member List</div>
        <div class="portlet-content" id="sf_admin_content" style="width: 98%">
            <table class="sf_admin_list" width="100%">
                <thead>
                <tr>
                    <th>Member</th>
                    <th>User Name</th>
                    <th>Company name</th>
                    <th>Fullname</th>
                    <th>Nric</th>
                    <th>Email</th>
                    <th>Contact</th>
                    <th>Fax</th>
                    <th>Gender</th>
                    <th>Dob</th>
                    <th>Bank name</th>
                    <th>Bank acc no</th>
                    <th>Bank holder name</th>
                    <th>Created on</th>
                </tr>
                </thead>
                <tbody>
                <?php
                $className = "sf_admin_row_1";
                foreach ($cms_members as $cms_member):
                    if ($className == "sf_admin_row_0") {
                        $className = "sf_admin_row_1";
                    } else {
                        $className = "sf_admin_row_0";
                    }

                    $appUser = AppUserPeer::retrieveByPK($cms_member->getUserId());
                ?>
                <tr class="<?php echo $className?>">
                    <td><?php echo link_to("Edit", 'member/memberEdit?member_id=' . $cms_member->getMemberId(), array ('class' => 'editLink')) ?></td>
                    <td><?php echo $appUser->getUserName() ?></td>
                    <td><?php echo $cms_member->getCompanyName() ?></td>
                    <td><?php echo $cms_member->getFullname() ?></td>
                    <td><?php echo $cms_member->getNric() ?></td>
                    <td><?php echo $cms_member->getEmail() ?></td>
                    <td><?php echo $cms_member->getContact() ?></td>
                    <td><?php echo $cms_member->getFax() ?></td>
                    <td><?php echo $cms_member->getGender() ?></td>
                    <td><?php echo $cms_member->getDob() ?></td>
                    <td><?php echo $cms_member->getBankName() ?></td>
                    <td><?php echo $cms_member->getBankAccNo() ?></td>
                    <td><?php echo $cms_member->getBankHolderName() ?></td>
                    <td><?php echo $cms_member->getCreatedOn() ?></td>
                </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
            <br>

            <div style="text-align: right">
                <?php echo link_to('create', 'member/memberCreate', array("id" => "btnCreate")) ?>
            </div>

        </div>
    </div>
</div>
